package com.rem.redis.controller;

import com.rem.redis.service.LockTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Rem
 * @date 2022-05-23
 */

@RestController
public class LockTestController {

    @Autowired
    LockTestService lockTestService;

    @PostMapping("/lock/setIfAbsent")
    public String seckill() {
        return lockTestService.setIfAbsentTransaction();
    }

    @PostMapping("/lock/redisson")
    public String redisson() {
        return lockTestService.redissonLock();
    }
}
